package com.bawei.module_home.ui.merchant

import android.util.Log
import android.view.View
import androidx.activity.viewModels
import com.alibaba.android.arouter.facade.annotation.Route
import com.bawei.lib_common.Router
import com.bawei.lib_common.base.BaseActivity
import com.bawei.lib_common.base.state.Empty
import com.bawei.lib_common.base.state.Failed
import com.bawei.lib_common.base.state.Loading
import com.bawei.lib_common.base.state.Success
import com.bawei.lib_common.observeWithLifecycle
import com.bawei.module_home.R
import com.bawei.module_home.adapter.FragmentAdapter
import com.bawei.module_home.adapter.MerchantAdapter
import com.bawei.module_home.databinding.ActivityMerchantBinding
import com.bawei.module_home.http.HomeServiceViewModel
import com.google.android.material.tabs.TabLayoutMediator
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
@Route(path = Router.MERCHANT_PAGE)
class MerchantActivity : BaseActivity<HomeServiceViewModel, ActivityMerchantBinding>() {
    override val mLayoutResId: Int
        get() = R.layout.activity_merchant
    private val mViewModel: HomeServiceViewModel by viewModels()
    val adapter: MerchantAdapter by lazy {
        MerchantAdapter()
    }
    override fun initView() {
        super.initView()
        mBinding.toobar.apply {
            back.setOnClickListener({
                finish()
            })
            title.text="入驻审批"
            more.visibility= View.GONE
        }

        val adapter= FragmentAdapter(this)
        mBinding.pager.adapter=adapter

        TabLayoutMediator(mBinding.tabLayout,mBinding.pager){tab,position->
            tab.text=when(position){
                0->"待确认"
                1->"已确认"
                else -> ""
            }

        }.attach()



    }

    override fun initData() {

    }

    override fun initListener() {

    }

    override fun onResume() {
        super.onResume()

    }

}